﻿#define _CRT_SECURE_NO_WARNINGS

#include<iostream>

using namespace std;

class A
{
public:
	//explicit A(int a1=10,int a2=10)
	A(int a1 = 10, int a2 = 10)

		:_a1(a1)
		,_a2(a2)
	{}
	void Print()
	{
		cout << _a1 << " " << _a2 << endl;
	}
private:
	int _a1 = 10;
	int _a2 = 10;
};

int main()
{
	// 1构造⼀个A的临时对象，再⽤这个临时对象拷⻉构造aa3
	// 编译器遇到连续构造+拷⻉构造->优化为直接构造
	A aa1=1;//==A aa1(1);
	aa1.Print();

	// C++11之后才⽀持多参数转化
	A aa2 = { 1,2 };//==A aa1(1,2);
	aa2.Print();
	return 0;
}